package com.weblog.weblogapi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.weblog.weblogapi.dao.mapper.MemberMapper;
import com.weblog.weblogapi.dao.pojo.Member;
import com.weblog.weblogapi.service.MemberService;
import com.weblog.weblogapi.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MemberServiceImpl implements MemberService {
    @Autowired
    private MemberMapper memberMapper;
    @Override
    public Result getAllMembers() {
        List<Member> members=memberMapper.selectList(new LambdaQueryWrapper<>());

        return Result.success(members);
    }

    @Override
    public Member findMemberByMemberId(int memberId) {
        Member member = memberMapper.selectById(memberId);
        return member;
    }
}
